import request from "@/utils/request";
import qs from "qs";

// 查询通知公告列表
export function listNotice(query) {
  return request({
    url: "/system/notice/list",
    method: "get",
    params: query,
  });
}

// 查询通知公告详细
export function getNotice(id) {
  return request({
    url: "/system/notice/" + id,
    method: "get",
  });
}

// 新增通知公告
export function addNotice(data) {
  return request({
    url: "/system/notice",
    method: "post",
    data: qs.stringify(data),
    headers: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}

// 修改通知公告
export function updateNotice(data) {
  return request({
    url: "/system/notice",
    method: "put",
    data: qs.stringify(data),
    headers: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}

// 删除通知公告
export function delNotice(id) {
  return request({
    url: "/system/notice/" + id,
    method: "delete",
  });
}
